#include <iostream>
#include <signal.h>

using namespace std;

void handler(int signo)
{
    cout << "System signal: " << signo << "replaced by handler!" << endl;
    exit(signo);
}


int main()
{
    // "ctrl + c" will be identified is "2" signal then send to process
    signal(SIGINT, handler);    // handler(SIGINT)

    while(true)
    {
        cout << "singal_test is running..." << endl;
        sleep(1);
    }
    return 0;
}